<?php
/* @var $this ArticleController */
/* @var $model Article */

$this->breadcrumbs=array(
	'Articles'=>array('index'),
	'Manage',
);

 
?>
<script type="text/javascript">
    $(document).ready(function(e) { 
        if(<?php echo isset($_GET['show'])?"true":"false" ?> ){ 
           setTimeout(function(){$('.phonesview').click()},500) ;
        } 
    }); 
</script>
<h1>门户产品</h1>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'article-grid',
	'dataProvider'=>$model->search_product(),
	'filter'=>$model,
    'template'=>"{items}{summary}{pager}",
    'summaryText'=>'每页显示10条,共{count}条',
    'summaryCssClass'=>'summaryinfo',
    'emptyText'=>'没有数据',
    'itemsCssClass'=>'itemsinfo',
    'pager'=>array(
        'class'=>'CLinkPager',
        'header'=>'',
        'nextPageLabel'=>'下一页',
        'prevPageLabel'=>'上一页',
        'firstPageLabel'=>'首页',
        'lastPageLabel'=>'尾页',
    ),
	'columns'=>array(
		//'id',
        array(
            'header' => '序号',
            'value' => '$this->grid->dataProvider->getPagination()->getOffset()+($row+1)', //CDataColumn $this->grid
            'htmlOptions' => array(
                'width' => '40px',
                "style"=> 'text-align:center',
            ),
        ),
		'title', 
		'hit',
        'createtime', 
        array(
            'class'=>'CButtonColumn',
            'header' => '操作', //指明头信息
            'deleteConfirmation'=>"js:'是否要删除此分类?'",  //修改删除提示语句
            'template' =>'{view}{update}{delete}{orderby}',
            'buttons' =>array(
                'view' => array(
                    'label'=>'显示',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/caz.png',
                    'url'=>'Yii::app()->createUrl("article/pview", array("id"=>$data->id))',
                ),
                'update' => array(
                    'label'=>'修改',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/bianji.png',
                    'url'=>'Yii::app()->createUrl("article/pupdate", array("id"=>$data->id))',
                ),
                'delete' => array(
                    'label'=>'删除',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/shanc.png',
                    'url'=>'Yii::app()->createUrl("article/pdelete", array("id"=>$data->id))',
                ),
                'orderby' => array(
                    'label'=>'置顶',
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/zhiding.png',
                    'url'=>'Yii::app()->createUrl("article/porderby", array("id"=>$data->id))',
                ),
            ),
        ),
	),
)); ?>

<div class="form">
        <?php echo CHtml::submitButton('新增',array('class'=>'subButton','onclick'=>'window.location.href="'.Yii::app()->createUrl('article/pcreate').'";')); ?></div>
